<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Aloha Editor command unlink tests</title>
	<!-- include qunit -->
	<link rel="stylesheet" href="../../vendor/qunit.css" type="text/css"/>

	<script type="text/javascript" src="../../vendor/qunit.js"></script>

	<script src="../../../lib/require.js" ></script>
	<!-- include jquery -->
	<script	src="../../../lib/vendor/jquery-1.7.2.js" ></script>
	<script type="text/javascript" src="../../vendor/jquery.simulate.js"></script>
	<script>
        require.config({
		    baseUrl: "../"
        });
		var Aloha = {
			settings: {
				jQuery: $,
				baseUrl: '../../../lib'
			}
		};
	</script>

	<!-- include aloha -->
	<script src="../../../lib/aloha.js" ></script>

	<!-- inject into testswarm -->
	<script type="text/javascript" src="../../vendor/swarminject.js"></script>
	<script>
		// load command test suite
		require( ['commandtest'] );
	</script>
	<style type="text/css">
		.aloha-editable ol li { list-style-type: decimal; margin: 1.5em; }
		.aloha-editable ol li ol li{ list-style-type: decimal; margin: 2em; }
	</style>
</head>
<body>
	<!-- include the tests -->
	<script>
	var tests = {
			defaultValue: '',
			defaultCommand: 'unlink',
			defaultAttributes: [ ],
			tests: [		        
           {  start: "foo[]bar",
              execResult: "foo[]bar"
           },
           {  start: "<p>[foo</p> <p>bar]</p>",
              execResult: "<p>[foo</p> <p>bar]</p>"
           },
           {  start: "<a href='http://www.google.com/'>foo[bar]baz</a>",
              execResult: "foo[bar]baz"
           }, 
           {  exclude: ['mozilla', 'msie9.0'],	
              start: "{<a href='http://www.google.com/'>foobar]baz</a>",
              execResult: "[foobar]baz"
           },
           {  start: "<a href='http://www.google.com/'>[foobarbaz]</a>",
              execResult: "[foobarbaz]"
           },
           {  start: "foo<a href='http://www.google.com/'>b[]ar</a>baz",
              execResult: "foob[]arbaz"
           },
           {  start: "foo<a href='http://www.google.com/'>[bar]</a>baz", 
              execResult: "foo[bar]baz" 
           },
           {  start: "foo[<a href='http://www.google.com/'>bar</a>]baz",
              execResult: "foo[bar]baz"
           },
           {  start: "foo<a href='http://www.google.com/'>[bar</a>baz]",
              execResult: "foo[barbaz]"
           },
           {  start: "[foo<a href='http://www.google.com/'>bar]</a>baz",
              execResult: "[foobar]baz"
           },
           {  start: "[foo<a href='http://www.google.com/'>bar</a>baz]",
              execResult: "[foobarbaz]"
           },
           {  start: "<a id=foo href='http://www.google.com/'>foobar[]baz</a>",
              execResult: "<a id='foo'>foobar[]baz</a>"
           },
           { 	start: "<a id=foo href='http://www.google.com/'>foo[bar]baz</a>",
              execResult: "<a id='foo'>foo[bar]baz</a>"
           },
           { 	start: "<a id=foo href='http://www.google.com/'>[foobarbaz]</a>",
              execResult: "<a id='foo'>[foobarbaz]</a>"
           },
           { 	start: "foo<a id=foo href='http://www.google.com/'>[bar]</a>baz",
              execResult: "foo<a id='foo'>[bar]</a>baz"
           },
           {  exclude: ["webkit", "msie7.0", "msie8.0"],
              start: "foo[<a id=foo href='http://www.google.com/'>bar</a>]baz",
              execResult: "foo[<a id='foo'>bar</a>]baz"
           },
           {  include: ["webkit"],
            	start: "foo[<a id=foo href='http://www.google.com/'>bar</a>]baz",
              execResult: "foo<a id='foo'>[bar]</a>baz"
           },
           { 	start: "[foo<a id=foo href='http://www.google.com/'>bar</a>baz]",
              execResult: "[foo<a id='foo'>bar</a>baz]"
           },
           { 	start: "<a name=foo>foobar[]baz</a>",
              execResult: "<a name='foo'>foobar[]baz</a>"
           },
           { 	start: "<a name=foo>foo[bar]baz</a>", 
              execResult: "<a name='foo'>foo[bar]baz</a>"
           },
           { 	start: "<a name=foo>[foobarbaz]</a>",
              execResult: "<a name='foo'>[foobarbaz]</a>"
           },
           { 	start: "foo<a name=foo>[bar]</a>baz",
              execResult: "foo<a name='foo'>[bar]</a>baz"
           },
           {  exclude: ["webkit", "msie7.0", "msie8.0"],
            	start: "foo[<a name=foo>bar</a>]baz",
              execResult: "foo[<a name='foo'>bar</a>]baz"
           },
           {  include: ["webkit"],
            	start: "foo[<a name=foo>bar</a>]baz",
              execResult: "foo<a name='foo'>[bar]</a>baz"
           },
           { 	start: "[foo<a name=foo>bar</a>baz]", 
              execResult: "[foo<a name='foo'>bar</a>baz]"
           }
			]
	}
	</script>
	<h1 id="qunit-header">Aloha Editor command unlink tests</h1>
	<h2 id="qunit-banner"></h2>
	<div id="qunit-testrunner-toolbar"></div>
	<h2 id="qunit-userAgent"></h2>
	<ol id="qunit-tests"></ol>
	<div id="qunit-fixture"></div>
	<div id="edit" style="margin:20px; border:1px solid #000000;"></div>
	<div id="logBody"></div>
	</div>
</body>
</html>
